.class public Lcom/hierynomus/smbj/smb2/messages/SMB2SessionSetup;
.super Lcom/hierynomus/smbj/smb2/d;
.source "SMB2SessionSetup.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/hierynomus/smbj/smb2/messages/SMB2SessionSetup$SMB2SecurityMode;,
        Lcom/hierynomus/smbj/smb2/messages/SMB2SessionSetup$SMB2SessionFlags;
    }
.end annotation


# instance fields
.field private c:Lcom/hierynomus/smbj/smb2/SMB2Dialect;

.field private d:B

.field private e:J

.field private f:[B

.field private g:J

.field private h:Ljava/util/EnumSet;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/EnumSet<",
            "Lcom/hierynomus/smbj/smb2/messages/SMB2SessionSetup$SMB2SessionFlags;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>()V
    .locals 0

    .line 1
    invoke-direct {p0}, Lcom/hierynomus/smbj/smb2/d;-><init>()V

    return-void
.end method

.method public constructor <init>(Lcom/hierynomus/smbj/smb2/SMB2Dialect;Ljava/util/EnumSet;)V
    .locals 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/hierynomus/smbj/smb2/SMB2Dialect;",
            "Ljava/util/EnumSet<",
            "Lcom/hierynomus/smbj/smb2/messages/SMB2SessionSetup$SMB2SecurityMode;",
            ">;)V"
        }
    .end annotation

    .line 2
    sget-object v0, Lcom/hierynomus/smbj/smb2/SMB2MessageCommandCode;->SMB2_SESSION_SETUP:Lcom/hierynomus/smbj/smb2/SMB2MessageCommandCode;

    const/16 v1, 0x19

    invoke-direct {p0, v1, p1, v0}, Lcom/hierynomus/smbj/smb2/d;-><init>(ILcom/hierynomus/smbj/smb2/SMB2Dialect;Lcom/hierynomus/smbj/smb2/SMB2MessageCommandCode;)V

    .line 3
    iput-object p1, p0, Lcom/hierynomus/smbj/smb2/messages/SMB2SessionSetup;->c:Lcom/hierynomus/smbj/smb2/SMB2Dialect;

    .line 4
    invoke-static {p2}, Les/ed0$a;->a(Ljava/util/Collection;)J

    move-result-wide p1

    long-to-int p2, p1

    int-to-byte p1, p2

    iput-byte p1, p0, Lcom/hierynomus/smbj/smb2/messages/SMB2SessionSetup;->d:B

    return-void
.end method

.method private a(Lcom/hierynomus/smbj/common/b;II)[B
    .locals 0
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/hierynomus/protocol/commons/buffer/Buffer$BufferException;
        }
    .end annotation

    if-lez p3, :cond_0

    .line 1
    invoke-virtual {p1, p2}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->f(I)V

    .line 2
    invoke-virtual {p1, p3}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->e(I)[B

    move-result-object p1

    return-object p1

    .line 3
    :cond_0
    new-instance p1, Lcom/hierynomus/smbj/common/SMBRuntimeException;

    const-string p2, "The SMB2 Session Setup response should contain a positive length security buffer"

    invoke-direct {p1, p2}, Lcom/hierynomus/smbj/common/SMBRuntimeException;-><init>(Ljava/lang/String;)V

    throw p1
.end method

.method private e(Lcom/hierynomus/smbj/common/b;)V
    .locals 5

    .line 1
    iget-object v0, p0, Lcom/hierynomus/smbj/smb2/messages/SMB2SessionSetup;->c:Lcom/hierynomus/smbj/smb2/SMB2Dialect;

    invoke-virtual {v0}, Lcom/hierynomus/smbj/smb2/SMB2Dialect;->isSmb3x()Z

    move-result v0

    if-eqz v0, :cond_0

    iget-wide v0, p0, Lcom/hierynomus/smbj/smb2/messages/SMB2SessionSetup;->g:J

    const-wide/16 v2, 0x0

    cmp-long v4, v0, v2

    if-eqz v4, :cond_0

    const/4 v0, 0x1

    .line 2
    invoke-virtual {p1, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a(B)Lcom/hierynomus/protocol/commons/buffer/Buffer;

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    .line 3
    invoke-virtual {p1, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a(B)Lcom/hierynomus/protocol/commons/buffer/Buffer;

    :goto_0
    return-void
.end method


# virtual methods
.method public a([B)V
    .locals 0

    .line 4
    iput-object p1, p0, Lcom/hierynomus/smbj/smb2/messages/SMB2SessionSetup;->f:[B

    return-void
.end method

.method protected b(Lcom/hierynomus/smbj/common/b;)V
    .locals 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/hierynomus/protocol/commons/buffer/Buffer$BufferException;
        }
    .end annotation

    .line 1
    invoke-virtual {p1}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->g()I

    .line 2
    invoke-virtual {p1}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->g()I

    move-result v0

    int-to-long v0, v0

    const-class v2, Lcom/hierynomus/smbj/smb2/messages/SMB2SessionSetup$SMB2SessionFlags;

    invoke-static {v0, v1, v2}, Les/ed0$a;->a(JLjava/lang/Class;)Ljava/util/EnumSet;

    move-result-object v0

    iput-object v0, p0, Lcom/hierynomus/smbj/smb2/messages/SMB2SessionSetup;->h:Ljava/util/EnumSet;

    .line 3
    invoke-virtual {p1}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->g()I

    move-result v0

    .line 4
    invoke-virtual {p1}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->g()I

    move-result v1

    .line 5
    invoke-virtual {p0}, Lcom/hierynomus/smbj/smb2/d;->a()Lcom/hierynomus/smbj/smb2/c;

    move-result-object v2

    invoke-virtual {v2}, Lcom/hierynomus/smbj/smb2/c;->f()Lcom/hierynomus/mserref/NtStatus;

    move-result-object v2

    sget-object v3, Lcom/hierynomus/mserref/NtStatus;->STATUS_SUCCESS:Lcom/hierynomus/mserref/NtStatus;

    if-eq v2, v3, :cond_0

    .line 6
    invoke-virtual {p0}, Lcom/hierynomus/smbj/smb2/d;->a()Lcom/hierynomus/smbj/smb2/c;

    move-result-object v2

    invoke-virtual {v2}, Lcom/hierynomus/smbj/smb2/c;->f()Lcom/hierynomus/mserref/NtStatus;

    move-result-object v2

    sget-object v3, Lcom/hierynomus/mserref/NtStatus;->STATUS_MORE_PROCESSING_REQUIRED:Lcom/hierynomus/mserref/NtStatus;

    if-ne v2, v3, :cond_1

    .line 7
    :cond_0
    invoke-direct {p0, p1, v0, v1}, Lcom/hierynomus/smbj/smb2/messages/SMB2SessionSetup;->a(Lcom/hierynomus/smbj/common/b;II)[B

    move-result-object p1

    iput-object p1, p0, Lcom/hierynomus/smbj/smb2/messages/SMB2SessionSetup;->f:[B

    :cond_1
    return-void
.end method

.method public c()[B
    .locals 1

    .line 1
    iget-object v0, p0, Lcom/hierynomus/smbj/smb2/messages/SMB2SessionSetup;->f:[B

    return-object v0
.end method

.method protected d(Lcom/hierynomus/smbj/common/b;)V
    .locals 4

    .line 1
    iget v0, p0, Lcom/hierynomus/smbj/smb2/d;->b:I

    invoke-virtual {p1, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->c(I)Lcom/hierynomus/protocol/commons/buffer/Buffer;

    .line 2
    invoke-direct {p0, p1}, Lcom/hierynomus/smbj/smb2/messages/SMB2SessionSetup;->e(Lcom/hierynomus/smbj/common/b;)V

    .line 3
    iget-byte v0, p0, Lcom/hierynomus/smbj/smb2/messages/SMB2SessionSetup;->d:B

    invoke-virtual {p1, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a(B)Lcom/hierynomus/protocol/commons/buffer/Buffer;

    .line 4
    iget-wide v0, p0, Lcom/hierynomus/smbj/smb2/messages/SMB2SessionSetup;->e:J

    const-wide/16 v2, 0x1

    and-long/2addr v0, v2

    invoke-virtual {p1, v0, v1}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->b(J)Lcom/hierynomus/protocol/commons/buffer/Buffer;

    .line 5
    invoke-virtual {p1}, Lcom/hierynomus/smbj/common/b;->n()Lcom/hierynomus/protocol/commons/buffer/Buffer;

    const/16 v0, 0x58

    .line 6
    invoke-virtual {p1, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->c(I)Lcom/hierynomus/protocol/commons/buffer/Buffer;

    .line 7
    iget-object v0, p0, Lcom/hierynomus/smbj/smb2/messages/SMB2SessionSetup;->f:[B

    array-length v0, v0

    invoke-virtual {p1, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->c(I)Lcom/hierynomus/protocol/commons/buffer/Buffer;

    .line 8
    iget-wide v0, p0, Lcom/hierynomus/smbj/smb2/messages/SMB2SessionSetup;->g:J

    invoke-virtual {p1, v0, v1}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->c(J)Lcom/hierynomus/protocol/commons/buffer/Buffer;

    .line 9
    iget-object v0, p0, Lcom/hierynomus/smbj/smb2/messages/SMB2SessionSetup;->f:[B

    invoke-virtual {p1, v0}, Lcom/hierynomus/protocol/commons/buffer/Buffer;->a([B)Lcom/hierynomus/protocol/commons/buffer/Buffer;

    return-void
.end method
